]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: Don't always ignore SubMenu children in width requests
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 6 Sep 2012 09:43:02 +0000 (11:43 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 6 Sep 2012 11:56:44 +0000 (13:56 +0200)
Hidden children are currently ignored in width requests; in the
case of submenu items, this results in abrupt width changes of
open menus when the corresponding SubMenuMenuItem is toggled.
To fix, only ignore SubMenu children when the corresponding
SubMenuMenuItem is hidden as well.

https://bugzilla.gnome.org/show_bug.cgi?id=683485

js/ui/popupMenu.js

index 5f8b999c2bfc6d88d40b13f86d5623c2ad6dc0c1..28be350da7ce9a9e405c8f0cfec0961b6f0d6732 100644 (file)
@@ -1100,7 +1100,8 @@ const PopupMenuBase = new Lang.Class({
         let columnWidths = [];
         let items = this.box.get_children();
         for (let i = 0; i < items.length; i++) {
-            if (!items[i].visible)
+            if (!items[i].visible &&
+                !(items[i]._delegate instanceof PopupSubMenu && items[i-1].visible))
                 continue;
             if (items[i]._delegate instanceof PopupBaseMenuItem || items[i]._delegate instanceof PopupMenuBase) {
                 let itemColumnWidths = items[i]._delegate.getColumnWidths();